package edu.ucla.whi.wanda;

import java.util.LinkedList;
import java.util.List;

import org.restlet.ext.wadl.ParameterInfo;
import org.restlet.ext.wadl.ParameterStyle;

public class SubjectNewResource extends BaseNewResource {
	public static final String path = "/subjects/add";
	public static final String description = "Add a new Subject";
	public static final String outputParamName = "Subject";
	
	
	public SubjectNewResource() {
		super(SUBJECTS_DOMAIN);
		
		initDescribe(path, description, outputParamName);
	}
	
	@Override
	protected List<ParameterInfo> postParams() {
		List<ParameterInfo> params = super.postParams();
		params.addAll(newParams());
		return params;
	}
	
	public static List<ParameterInfo> newParams() {
		List<ParameterInfo> params = new LinkedList<ParameterInfo>();
		
		// required
		params.add(new ParameterInfo("Name", true, "xsd:string", ParameterStyle.QUERY, 
				"Subject's name"));
		params.add(new ParameterInfo("Gender", true, "xsd:string", ParameterStyle.QUERY, 
				"Subject's gender"));
		
		// optional
		params.add(new ParameterInfo("Age", false, "xsd:string", ParameterStyle.QUERY, 
				"Subject's Age"));
		params.add(new ParameterInfo("Ethnicity", false, "xsd:string", ParameterStyle.QUERY, 
				"Subject's ethnicity"));
		params.add(new ParameterInfo("DOB", false, "xsd:string", ParameterStyle.QUERY, 
				"Subject's DOB"));
		
		
		return params;
	}
	
}